<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('videos', function (Blueprint $table) {
            $table->id();
            $table->text('title')->comment('标题');
            $table->string('face_img')->default('')->comment('封面');
            $table->string('url')->default('')->comment('链接');
            $table->string('shareid')->default('')->comment('用于ppvod视频frame播放');
            $table->bigInteger('category_id')->default(1)->index()->comment('分类');
            $table->tinyInteger('state')->default(1)->index()->nullable()->comment('状态：1正常，0停用');
            $table->tinyInteger('is_recommend')->default(0)->index()->comment('是否推荐：1正常，0停用');
            $table->integer('play_count')->default(0)->comment('播放量');
            $table->integer('playnum')->nullable()->default(0)->comment('支付次数');
            $table->string('time')->nullable()->comment('时长');
            $table->mediumText('base64')->nullable()->comment('base64');
            
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('videos');
    }
}
